package com.definesys.smecrailtransit.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.definesys.smecrailtransit.service.Notification.NotificationService;

/**
 * Created by xupeizuo on 2017/7/21.
 */

public class BootBroadcastReceiver extends BroadcastReceiver {

    private static final String TAG ="BootBroadcastReceiver";

    private static final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {

        Log.e(TAG, "************************************************************************************************");

        if (intent.getAction().equals(ACTION_BOOT)) {
            Log.e(TAG, "BootBroadcastReceiver onReceive(), Do thing!");
            Intent service = new Intent(context, NotificationService.class);
            context.startService(service);
        }
    }
}
